package com.xidian.zhiancloud.controller.riskcontrol.risksystem;

import com.xidian.zhiancloud.controller.base.BaseController;
import com.xidian.zhiancloud.dto.ResultDTO;
import com.xidian.zhiancloud.enums.GeneralResponseEnums;
import com.xidian.zhiancloud.model.riskcontrol.TRiskEvaluationCycleSettingList;
import com.xidian.zhiancloud.service.riskcontrol.risksystem.TRiskEvaluationCycleSettingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 系统设置-评价周期设置表
 */
@RestController
@RequestMapping("/trecycleset")
public class TRiskEvaluationCycleSettingController extends BaseController {

    @Autowired
    TRiskEvaluationCycleSettingService tRiskEvaluationCycleSettingService;

    /**
     * 系统设置-评价周期设置列表
     *
     * @return 返回 ResultDTO 对象
     */
    @RequestMapping("/getTREvaCycleSettingList")
    public ResultDTO getTREvaCycleSettingList(){
        Long companyId = this.getSessionUserCompanyId();
        return ResultDTO.successOf(tRiskEvaluationCycleSettingService.
                getTREvaCycleSettingList(companyId),GeneralResponseEnums.SUCCESS);
    }

    /**
     * 系统设置-评价周期设置保存
     *
     * @return 返回 ResultDTO 对象
     */
    @RequestMapping("/addTREvaCycleSettingList")
    public ResultDTO addTREvaCycleSettingList(
            TRiskEvaluationCycleSettingList tREvaCycleSet){
        Long companyId = this.getSessionUserCompanyId();
        tREvaCycleSet.setCompanyId(companyId);
        tRiskEvaluationCycleSettingService.addTREvaCycleSetting(tREvaCycleSet);
        return ResultDTO.successOf(GeneralResponseEnums.SUCCESS);
    }


}
